/**
 * Copyright (c) Software Institude of PKU
 * All rights reserved. 
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 */
package edu.pku.sei.modeler.model.uml.CompleteActivities;
// imports:
import org.w3c.dom.Element;

import edu.pku.sei.gefcommon.descriptor.annotation.MethodProperty;
import edu.pku.sei.modeler.model.common.*;
import edu.pku.sei.modeler.model.core.*;
import edu.pku.sei.modeler.model.xml.XMLUtility;


import edu.pku.sei.modeler.model.uml.Kernel.Parameter;
import edu.pku.sei.modeler.uml.modelHelper.ModelPackage;

/**
 * @generated
 *
 */
public class ActivityParameter extends Parameter implements IActivityParameter {
	// attributes
	
	protected boolean isException;
	
	protected boolean isStream;
	
	protected ParameterEffectKind effect;
	
	
	
	
	// references
	
	
	
	// getters & setters for attributes
	
	@MethodProperty(
			id = "ACTIVITYPARAMETER_ISEXCEPTION",
			catalog = "Model",
			name = ModelPackage.ACTIVITYPARAMETER_ISEXCEPTION,
			setter = "setisException"
			)
	
	public boolean getIsException() {
		return isException;
	}
	public void setIsException(boolean newIsException) {
		boolean oldisException = isException;
		isException = newIsException;
		firePropertyChange(ModelPackage.ACTIVITYPARAMETER_ISEXCEPTION, oldisException, newIsException);
	}
	
	@MethodProperty(
			id = "ACTIVITYPARAMETER_ISSTREAM",
			catalog = "Model",
			name = ModelPackage.ACTIVITYPARAMETER_ISSTREAM,
			setter = "setisStream"
			)
	
	public boolean getIsStream() {
		return isStream;
	}
	public void setIsStream(boolean newIsStream) {
		boolean oldisStream = isStream;
		isStream = newIsStream;
		firePropertyChange(ModelPackage.ACTIVITYPARAMETER_ISSTREAM, oldisStream, newIsStream);
	}
	
	public ParameterEffectKind getEffect() {
		return effect;
	}
	public void setEffect(ParameterEffectKind newEffect) {
		ParameterEffectKind oldeffect = effect;
		effect = newEffect;
		firePropertyChange(ModelPackage.ACTIVITYPARAMETER_EFFECT, oldeffect, newEffect);
	}
	
	// getters for references
	
	// save & load
	public void serialize(Element root) {
		super.serialize(root);
		// attributes
		
		XMLUtility.xmlInstance.serializeAttribute(root, ModelPackage.ACTIVITYPARAMETER_ISEXCEPTION, isException);
		
		XMLUtility.xmlInstance.serializeAttribute(root, ModelPackage.ACTIVITYPARAMETER_ISSTREAM, isStream);
		
		XMLUtility.xmlInstance.serializeNode(root, ModelPackage.ACTIVITYPARAMETER_EFFECT, effect);
		
		// references
		
	}
	
	public void deSerialize(Element root) {
		super.deSerialize(root);
		// attributes
		
		isException = XMLUtility.xmlInstance.deSerializeBoolean(root, ModelPackage.ACTIVITYPARAMETER_ISEXCEPTION);
		
		isStream = XMLUtility.xmlInstance.deSerializeBoolean(root, ModelPackage.ACTIVITYPARAMETER_ISSTREAM);
		
		effect = (ParameterEffectKind)XMLUtility.xmlInstance.deSerializeNode(root, ModelPackage.ACTIVITYPARAMETER_EFFECT, this);
		
		// references
		
	}
	
	public void dynamicSet(String featureID, Object value) {
		if(featureID == null || "".equals(featureID)) {
			return;
		}
		// attributes
		
		else if(ModelPackage.ACTIVITYPARAMETER_EFFECT.equals(featureID)) {
			effect = (ParameterEffectKind)value;
		}
		
		// references
		
		else
			super.dynamicSet(featureID, value);
	}
}
 
 
 
 
 